import React from 'react';
import { Button, Checkbox, Form, Input } from 'antd';
import request from '../../api/request'
import { useNavigate } from 'react-router-dom';
import style from '../login/index.module.css'
import { UserOutlined ,ShoppingOutlined,BorderOuterOutlined} from '@ant-design/icons';
// import { useNavigate } from 'react-router-dom';
function Index() {
 const nav=useNavigate()
  const onFinish = values => {
    nav('/login')

};
const onFinishFailed = errorInfo => {
  console.log('Failed:', errorInfo);
};
  return (
    <div className={style.op}>
        <div className={style.pp}>
  <Form
    name="basic"
    labelCol={{ span: 8 }}
    wrapperCol={{ span: 16 }}
    style={{ maxWidth: 600 }}
    initialValues={{ remember: true }}
    onFinish={onFinish}
    onFinishFailed={onFinishFailed}
    autoComplete="off"
  >
    <Form.Item
      label=""
      name="1"
      // 手机号正则
      rules={[{ required: true, message: '请输入正确的手机号' },
      { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号' },
      ]}


    >
      <Input  prefix={<UserOutlined />}/>
    </Form.Item>



     <Form.Item
      label=""
      name="2"

    rules={[{ required: true, message: '请输入正确的密码' },
        { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的密码' },
    ]}
    >
      <Input.Password  prefix={<ShoppingOutlined />}/>
    </Form.Item>
     <Form.Item
      label=""
      name="3"
      //123456正则
    rules={[{ required: true, message: '请输入正确的密码' },
      { pattern: /^1[3456789]\d{9}$/, message: '请再次输入密码' },
    ]}
    >
      <Input.Password  prefix={<BorderOuterOutlined />}/>
    </Form.Item>
      <p style={{color:'blue',marginLeft:'150px'}}>还没有登录账号?请立即登录</p>
   

    <Form.Item label={null}>
      <Button type="primary" htmlType="submit" >
      验证账号
      </Button>
    </Form.Item>
  </Form>
        </div>
 
    </div>
  )
}

export default Index
